<template>
  <van-nav-bar
    :title="title"
    left-text="返回"
    left-arrow
    @click-left="$router.back()"
  >
  <template #right v-if="button">
    <van-button size="mini" type="info" @click="onClickRight">{{ button }}</van-button>
  </template>
</van-nav-bar>

</template>

<script>
export default {
  name: "VueEleMNavbar",
  props: {
    title: {
      type: String
    },
    button: {
      type: String
    },
    buttonEventHandle: {
      type: String
    },
  },
  data() {
    return {};
  },

  mounted() {},

  methods: {
    onClickRight() {
      this.$bus.$emit(this.buttonEventHandle)
    }
  },
};
</script>